<template>
    <div>
        <!-- <div class="header bg-grey">
            <div class="header-left">
                <div class="back" @click="handleReturn">
                    <i class="i-left"></i>
                </div>
            </div>
            <div class="header-middle m-l-12"><span class="font-black">物流信息</span></div>
            <div class="header-right">
                
            </div>
        </div> -->
        <div class="shipping">
            <div class="shipping_header" v-if="shippingName && shippingNo">
                <div class="header_item"><span>物流公司：</span><span>{{shippingName}}</span></div>
                <div class="header_item"><span>运单号码：</span><span>{{shippingNo}}</span></div>
            </div>
            <!--<logistics v-if="list.length>0" :list="list"></logistics>-->
            <!--<van-steps direction="vertical" :active="activeIndex" active-color="#e60012">-->
                <!--<van-step v-for="val in list">-->
                    <!--<h3>{{val.acceptStation}}</h3>-->
                    <!--<p>{{val.acceptTime}}</p>-->
                <!--</van-step>-->
                <!--<van-step>-->
                    <!--<h3>【城市】物流状态1</h3>-->
                    <!--<p>2016-07-12 12:40</p>-->
                <!--</van-step>-->
                <!--<van-step>-->
                    <!--<h3>【城市】物流状态2</h3>-->
                    <!--<p>2016-07-11 10:00</p>-->
                <!--</van-step>-->
                <!--<van-step>-->
                    <!--<h3>快件已发货</h3>-->
                    <!--<p>2016-07-10 09:30</p>-->
                <!--</van-step>-->
            <!--</van-steps>-->
        </div>

    </div>
</template>

<script>
import { autoLogin } from '@/utils'     
import logistics from "@/components/logistics"
import { getShipping } from "@/api/goods"
import { Dialog } from 'vant'

export default {
    name: "shipping",
    components: { navbar,logistics },
    created(){
        autoLogin()
        this.orderId = this.$route.params.orderId
        // this.getDetail()
    },
    data(){
        return {
            orderId: 0,
            activeIndex: 0,
            shippingName: "",
            shippingNo: "",
            list: []
        }
    },
    methods:{
        getDetail(){
            const data = {}
            data.orderId = this.orderId
            getShipping(data).then(respone=>{
                if(respone.shippingNo && respone.shippingName){
                    this.shippingNo = respone.shippingNo
                    this.shippingName = respone.shippingName
                }
                else{
                    Dialog.alert({
                        title: "",
                        message: "暂无物流信息"
                    }).then(() => {
                    })
                }
                if(respone.data){
                    this.list = respone.data

                }
            })
        },
        handleBack(){
            this.$router.push('/user/order')
        }
    }
}
</script>
